<?php slot('user', $user); ?>
<?php slot('sub', $sub); ?>
<?php slot('menu', $menu); ?>

<script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyA4ORL54bd4TqneYqWekkc22xhZ1T3gH6A&sensor=false"></script>
<?php use_javascript('jquery-1.11.0.js') ?>
<?php use_javascript('jquery-ui.js') ?>
<?php use_javascript('vars.js') ?>
<?php use_javascript('info_hotel.js') ?>

<div class="center">
    <div id="center_conteiner" class="clearfix">
        <div class="center_sub_conteiner"> 

            <div class="center_block">
                <div class="header_center_block" value="<?php echo $hotel['id']; ?>" civic="<?php echo $type; ?>"><span><?php echo $hotel['name_en']; ?></span></div>

                <div class="hotel_image_column_container">
                    <div class="hotel_main_image">
                        <div class="main_images">
                            <?php
                            if ($hotel['photo']) {
                                $images = explode(';', $hotel['photo']);
                                for ($i = 0; $i < (count($images) - 1); $i++) {
                                    echo '<img class="image_hotel_' . $i . '"  src="' . $images[$i] . '" value="' . $i . '">';
                                }
                            } else {
                                echo '<img src="../images/empty.png">';
                            }
                            ?>
                        </div>
                    </div>


                    <div class="arrows_image_container">
                        <div class="arrows_left_image"><img src="/web/images/left-arrow.png"></div>
                        <div class="arrows_rigth_image"><img src="/web/images/right-arrow.png"></div>
                    </div>
                </div>

                <div class="hotel_description_column">
                    <div class="hotel_main_description_container">
                        <div class="hotel_description_name"><?php echo $hotel['name_en']; ?></div>
                        <div class="hotel_description_stars">
                            <?php
                            switch ($hotel['stars']) {
                                case 1:
                                    echo '<img src="/web/images/icoStar.png">';
                                    break;
                                case 2:
                                    echo '<img src="/web/images/icoStars2.png">';
                                    break;
                                case 3:
                                    echo '<img src="/web/images/icoStars3.png">';
                                    break;
                                case 4:
                                    echo '<img src="/web/images/icoStars4.png">';
                                    break;
                                case 5:
                                    echo '<img src="/web/images/icoStars5.png">';
                                    break;
                            }
                            ?>
                        </div>
                        <div class="hotel_description_des"><?php echo $hotel['description_en']; ?></div>
                    </div>

                    <div class="hotel_description_address_info">
                        <div class="hotel_description_address_info_header">Contact information</div>
                        <div class="hotel_description_address"><label>Address: </label><?php echo $hotel['address']; ?></div>
                        <div class="hotel_description_phones"><label>Phone: </label><?php echo $hotel['phone1'] . ' ' . $hotel['phone2']; ?></div>
                        <div class="hotel_description_fax"><label>Fax: </label><?php echo $hotel['fax']; ?></div>
                        <div class="hotel_description_email"><label>E-mail: </label><?php echo $hotel['email']; ?></div>
                        <div class="hotel_description_link"><label>Web site: </label><a href="<?php echo $hotel['web_site'] ?>"><?php echo $hotel['web_site'] ?></a></div>
                    </div>
                </div>

            </div>

            <div class="center_block">
                <div class="header_center_block">
                    <span>Map</span>
                    <div class="show_map">Show</div>
                </div>
                <div class="map_hotel_container" id="hotel_map"></div>
            </div>

            <div class="center_block">
                <div class="header_center_block">
                    <span>Rooms</span>
                    <div class="change_date" dfrom="<?php echo $date_from ?>" dto="<?php echo $date_to ?>"><?php echo 'from date: ' . $date_from . ' to date: ' . $date_to; ?><label>Change date</label></div>
                </div>
                <div class="rooms_hotel_date">
                    <div class="rooms_hotel_date_in">
                        <label for="date_rooms_hotel_date_in">Check in</label>
                        <input type="text" id="date_rooms_hotel_date_in">
                        <img src="/web/images/icoCalendar.png"/>
                    </div>

                    <div class="rooms_hotel_date_night">
                        <label for="date_rooms_hotel_night">Night</label>
                        <select id="date_rooms_hotel_night"></select>
                    </div>

                    <div class="rooms_hotel_date_out">
                        <label for="date_rooms_hotel_date_out">Check out</label>
                        <input type="text" id="date_rooms_hotel_date_out">
                        <img src="/web/images/icoCalendar.png"/>
                    </div>

                    <div class="rooms_hotel_date_update">Update</div>
                </div>

                <div class="room_hotel_description_title">
                    <div class="room_hotel_description_title_type">Room</div>
                    <div class="room_hotel_description_title_service">Service</div>
                    <div class="room_hotel_description_title_guest">Guests</div>
                    <div class="room_hotel_description_title_price">Price</div>
                    <div class="room_hotel_description_title_book">Booking</div>
                </div>

                <div class="room_hotel_description_container">
                    <div class="page_main_right_col">
                        <div class="page_main_left_col">

                            <div class="page_main_sub_left_col">                                
                                <?php
                                $count = count($hotel['Rooms']);
                                foreach ($hotel['Rooms'] as $r) {
                                    echo '<div class="rhd_room" value="' . $r['id'] . '" key="' . $r['RoomPrice']['key'] . '"  price="' . $r['RoomPrice']['bar_price_usd'] . '">' .
                                    '<div class="rhd_room_error"></div>' .
                                    '<div class="rhd_type">' .
                                    '<div class="rhd_type_name">' . $r['name'] . '</div>' .
                                    '<div class="rhd_type_short">' . $r['description_en'] . '</div></div>' .
                                    '<div class="rhd_service">' . $r['description_en'] . '</div>' .
                                    '<div class="rhd_guest">' .
                                    '<div class="rhd_guest_adult">adult: ' . $r['adult'] . '</div>' .
                                    '<div class="rhd_guest_children">children: ' . $r['children'] . '</div>' .
                                    '<div class="rhd_guest_baby">baby: ' . $r['baby'] . '</div></div>' .
                                    '<div class="rhd_price">' .
                                    '<div class="rhd_price_sum" value="" price="' . $r['RoomPrice']['bar_price_usd'] . '">' . $r['RoomPrice']['bar_price_usd'] . '$</div>' .
                                    '<div class="rhd_price_choice"><label>Choice</label><select>';
                                    for ($i = 0; $i <= $r['RoomPrice']['vacancies']; $i++) {
                                        echo '<option value="' . $i . '">' . $i . '</option>';
                                    }
                                    echo '</select></div></div></div>';
                                    if ($count > 1) {
                                        echo '<div class="rhd_room_separator"></div>';
                                    }

                                    $count--;
                                }
                                ?>
                            </div>

                            <div class="page_main_sub_right_col">
                                <?php
                                $count = count($hotel['Rooms']);
                                if ($count > 0) {
                                    echo '<div class="room_button_book" value="'.$search['rooms'].'">Reserve it</div>' .
                                    '<div class="room_book_sum">Total: <label>0</label>$</div>' .
                                    '<div class="room_book_error">Error: not selected not one room.</div>';
                                }
                                ?>
                            </div>

                        </div>
                    </div>
                </div>

            </div>

        </div>
    </div>
</div>
